package day2.about_attributes.demo4_daemon;
/**
 * 主线程结束，后台线程也会退出
 */
public class Main2 {
    private static class MyThread extends Thread {
        @Override
        public void run() {
            while (true) {
                System.out.println("你好");
            }
        }
    }

    public static void main(String[] args) {
        MyThread t = new MyThread();
        t.setDaemon(true);
        t.start();
    }
}
